﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace yaai
{
    public partial class addList : Form
    {

        Form1 form;

        public addList(Form1 form)
        {
            this.form = form;
            InitializeComponent();
        }

        private void btn_ok_Click(object sender, EventArgs e)
        {
            WordList newList = new WordList(txt_name.Text, new List<String>(), txt_filename.Text);

            form.lists.Add(newList);

            newList.changed = true;
            newList.writeAllToFile();
            this.Close();
        }

        private void btn_cancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
